<form class="form-horizontal form-bordered" action="add" method="post">
	<input type="hidden" name="data[id]" value="<?php echo $data['Post']['id'];?>">
	<div class="form-group">
		<label class="col-sm-2 control-label">Tên bài viết</label>
		<div class="col-sm-5">
			<input type="text" class="form-control" name="data[title]" value="<?php echo $data['Post']['title']; ?>"/>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">Chuyên mục</label>
		<div class="col-sm-5">
			<select class="form-control input-sm mb15" name="data[catId]">
				<?php foreach($cats as $item){?>
				<option <?php  echo $data['Post']['catId'] == $item['Category']['id']? "select":""; ?> value="<?php echo $item['Category']['id']?>"><?php echo $item['Category']['name']?></option>
				<?php } ?>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">Nội dung</label>
		<div class="col-sm-10">
			<textarea id="ckeditor" placeholder="Enter text here..." class="form-control" rows="10" name="data[details]">
				<?php echo $data['Post']['details'];?>
			</textarea>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-10">
			<button class="btn btn-default" type="reset">Reset</button>
			<button class="btn btn-success">Submit</button>
		</div>
	</div>
</form>
<script src="/js/ckeditor/ckeditor.js"></script>
<script src="/js/ckeditor/adapters/jquery.js"></script>
<script>
jQuery(document).ready(function(){
	//jQuery('#ckeditor').ckeditor();
	CKEDITOR.replace('ckeditor',{
		filebrowserBrowseUrl : '/js/kcfinder/browse.php?type=files',
		filebrowserImageBrowseUrl : '/js/kcfinder/browse.php?type=images',
		filebrowserFlashBrowseUrl : '/js/kcfinder/browse.php?type=flash',
		filebrowserUploadUrl : '/js/kcfinder/upload.php?type=files',
		filebrowserImageUploadUrl : '/js/kcfinder/upload.php?type=images',
		filebrowserFlashUploadUrl : '/js/kcfinder/upload.php?type=flash'
	});
});
</script>
